<%= form_for [:admin, @game], html: { class: "card" } do |f| %>
  <%= render 'admin/shared/error_messages', target: @game %>
  <div class="card-body">
    <h3 class="card-title">
      <%= @game.new_record? ? "新建比赛" : "修改比赛" %>
    </h3>
    <div class="row">
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">所属联赛</label>
          <%= f.select :league_game_id, LeagueGame.select('id, name').map{ |t| [t.name, t.id] }, { include_blank: '请选择联赛' }, { class: 'form-control select' } %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">开始时间</label>
          <%= f.datetime_field :begin_at, class: "form-control" %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">主队</label>
          <%= f.select :master_id, Team.select('id, name').map{ |t| [t.name, t.id] }, { include_blank: '请选择队伍' }, { class: 'form-control select' } %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">主队比分</label>
          <%= f.number_field :master_score, class: "form-control" %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">客队</label>
          <%= f.select :guest_id, Team.select('id, name').map{ |t| [t.name, t.id] }, { include_blank: '请选择队伍' }, { class: 'form-control select' } %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">客队比分</label>
          <%= f.number_field :guest_score, class: "form-control" %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">主队指数</label>
          <%= f.number_field :master_index, class: "form-control", step: '0.001' %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">客队指数</label>
          <%= f.number_field :guest_index, class: "form-control", step: '0.001' %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">盘口</label>
          <%= f.text_field :sb, class: "form-control" %>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-12">
        <div class="form-group">
          <label class="form-label">备注</label>
          <%= f.text_field :remark, class: "form-control" %>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <div class="form-label">推荐哪队</div>
          <div class="custom-controls-stacked">
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :master_or_guest, true, { class: "custom-control-input" } %>
              <span class="custom-control-label">主队</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :master_or_guest, false, { class: "custom-control-input" } %>
              <span class="custom-control-label">客队</span>
            </label>
          </div>
        </div>
      </div>
      <div class="col-md-6">
        <div class="form-group">
          <div class="form-label">推荐</div>
          <div class="custom-controls-stacked">
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :propose, "win", { class: "custom-control-input" } %>
              <span class="custom-control-label">赢</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :propose, "lose", { class: "custom-control-input" } %>
              <span class="custom-control-label">输</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :propose, "big", { class: "custom-control-input" } %>
              <span class="custom-control-label">大</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :propose, "small", { class: "custom-control-input" } %>
              <span class="custom-control-label">小</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :propose, "one", { class: "custom-control-input" } %>
              <span class="custom-control-label">单</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :propose, "two", { class: "custom-control-input" } %>
              <span class="custom-control-label">双</span>
            </label>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-6">
        <div class="form-group">
          <div class="form-label">是否结束</div>
          <div class="custom-controls-stacked">
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :state, "pending", { class: "custom-control-input" } %>
              <span class="custom-control-label">未结束</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :state, "winned", { class: "custom-control-input" } %>
              <span class="custom-control-label">赢盘</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :state, "losed", { class: "custom-control-input" } %>
              <span class="custom-control-label">输盘</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :state, "winned_half", { class: "custom-control-input" } %>
              <span class="custom-control-label">赢半</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :state, "losed_half", { class: "custom-control-input" } %>
              <span class="custom-control-label">输半</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :state, "tie", { class: "custom-control-input" } %>
              <span class="custom-control-label">走盘</span>
            </label>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="card-footer text-right">
    <button type="submit" class="btn btn-primary">保 存</button>
  </div>
<% end %>